<div id="page-content">
    <div class="panel panel-default">
        <div class="panel-heading">
            <div class="clear">
                <div class="pull-left"><h4>任务列表</h4></div>
                <div class="pull-right"><button class="btn btn-primary" v-on:click="addNew">新增任务</button></div>
            </div>
        </div>
        <div class="panel-body">
            <div class="input-group custom-search-form">
                <input type="text" class="form-control" placeholder="搜索" id="search-task" v-model.trim="search.task" v-on:input="searchTask">
                <span class="input-group-btn">
                    <button class="btn btn-default" type="button" v-on:click="searchTask"><i class="fa fa-search"></i></button>
                </span>
            </div>

            <table class="table table-bordered table-hover">
                <thead>
                    <tr>
                        <th>序号</th>
                        <th>标题</th>
                        <th>备注</th>
                        <th>上传</th>
                        <th>生成</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    <tr v-for="(task, tk) in tasks" v-show="!task.filteredout">
                        <td>{{task.id}}</td>
                        <td>{{task.title}}</td>
                        <td>{{task.comments}}</td>
                        <td>{{task.create_time}}</td>
                        <td>{{task.result_time}}</td>
                        <td>{{task.status_text}}</td>
                        <td><a v-if="task.stat == 1" v-bind:href="task.result" class="btn btn-default" target="_blank">View</a></td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <!-- Modal -->
    <div class="modal fade" id="theModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="theModalLabel">New Task</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label for="theTip">说明</label>
                        <p id="theTip"><?php echo $parser->info(); ?></p>
                    </div>

                    <div class="form-group" v-bind:class="{ 'has-error': modal.title == '' }">
                        <label for="theName">标题</label>
                        <input type="text" class="form-control" id="theName" placeholder="标题" v-model.trim="modal.title">
                    </div>

                    <div class="form-group" v-bind:class="{ 'has-error': modal.comments == '' }">
                        <label for="theComments">备注</label>
                        <input type="text" class="form-control" id="theComments" placeholder="备注" v-model.trim="modal.comments">
                    </div>

                    <div class="form-group">
                        <label for="theFile">上传文件</label>
                        <input type="file" id="theFile">
                        <p class="help-block">上传要分析的文件.</p>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="button" class="btn btn-primary" v-on:click="ensure">确认</button>
                </div>
            </div>
        </div>
    </div>

</div>


